import { createRouter, createWebHistory } from 'vue-router'
const routes = [
    {
        path: '/',
        component: () => import('../view/main.vue'),
        redirect: '/home',
        name: 'main',
        children: [{
            path: '/home',
            name: 'home',
            component: () => import('../view/home.vue')
        }, {
            path: '/user',
            name: 'user',
            component: () => import('../view/user.vue')
        }, {
            path: '/page1',
            name: 'page1',
            component: () => import('../view/page1.vue')
        }, {
            path: '/page2',
            name: 'page2',
            component: () => import('../view/page2.vue')
        }]
    }, {
        path: '/login',
        name: 'login',
        component: () => import('../view/login.vue')
    }
]
const router = createRouter({
    history: createWebHistory(),
    routes
})
export default router